home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d13
/
phantz.arc
/
PHANT5.Z
/
PHANT5
Wrap
Text File
|
1991-06-06
|
60KB
|
2,459 lines
: ---------CUT HERE---------
: This is a shar archive. Extract with sh, not csh.
: The rest of this file will extract:
: phant.nr interplayer.c
echo x - phant.nr
sed 's/^X//' > phant.nr << '!EOR!'
X.de sh
X.br
X.ne 5
X.PP
X\fB\\$1\fR
X.PP
X..
X.TH PHANTASIA 6 GAMES
X.UC 4
X.SH NAME
Xphantasia \- an interterminal fantasy game
X.SH SYNOPSIS
X.B phantasia
X[
X.B \-s
X] [
X.B \-m
X] [
X.B \-a
X] [
X.B \-x
X] [
X.B \-h
X] [
X.B \-H
X] [
X.B \-p
X] [
X.B \-b
X] [
X.B \-S
X]
X.SH DESCRIPTION
X.I Phantasia
Xis a role playing game
Xwhich allows players to roll up characters of various types to fight
Xmonsters and other players.
XProgression of characters is based upon gaining experience from fighting
Xmonsters (and other players).
X.PP
XMost of the game is menu driven and self-explanatory (more or less).
XThe screen is cursor updated, so be sure to set up the
X.B TERM
Xvariable in your environment.
X.PP
XThe options provide for a variety of functions to support the game.
XThey are:
X.PP
X.TP .5i
X.B \-s
XInvokes
X.I phantasia
Xwithout header information.
X.TP .5i
X.B \-m
XGet a monster listing.
X.TP .5i
X.B \-a
XGet a listing of all character names on file.
X.TP .5i
X.B \-x
XExamine/change a particular character on file.
X.TP .5i
X.B \-h
XPrint a help listing (this message).
X.TP .5i
X.B \-H
XPrint header only.
X.TP .5i
X.B \-p
XPurge old characters.
X.TP .5i
X.B \-b
XShow scoreboard of top characters per login.
X.TP .5i
X.B \-S
XTurn on wizard options, if allowed.
X.PP
XThe characters are saved on a common file, in order to make the game
Xinteractive between players. The characters are given a password
Xin order to retrieve them later. Only characters above
X.B level
Xzero are saved. Characters unused for awhile will be purged.
XCharacters are only placed on the scoreboard when they die.
X.SH AUTHOR
XEdward Estes, AT&T Information Systems, Skokie, IL
X.SH PARTICULARS
X.sh "Normal Play"
XA number of the player's more important statistics are almost always
Xdisplyed on the screen, with maximums (where applicable) in
Xparentheses.
X.PP
XThe character is placed randomly near the center of a cartesian
Xsystem.
XMost commands are selected with a single letter or digit.
XFor example, one may move by hitting 'W', 'S', 'N', or 'E',
X(lower case may also be used, at no time is the game case dependent).
XOne may also use 'H', 'J', 'K', 'L',
Xfor movement, similar to
X.IR vi (1).
XTo move to a specific (x, y) coordinate, use the
X.B move
X('1') command. The distance a character can move is calculated by
X1 plus 1.5 per
X.B level.
XMoving in a compass direction will move the player the maximum
Xallowed distance in that direction.
X.PP
XA player may see who else is playing by using the
X.B players
X('2') option. One may see the coordinates of those who are the same
Xdistance or closer to the origin as he/she.
X.B Kings,
Xand
X.B council of the wise
Xcan see and can be seen by everyone. A
X.B palantir
Xremoves these retrictions.
X.PP
XOne can talk to other players with the
X.B talk
X('3') option. In general, this is a line or so of text. To remove a current
Xmessage, just type <return> when prompted for a message.
X.PP
XThe
X.B stats
X('4') option shows additional characteristics of a player.
X.PP
XOne may leave the game either with the
X.B quit
X('5') option.
X.PP
XOne may rest by default. Resting lets one regain maximum
X.B energy level,
Xand also lets one find
X.B mana
X(more is found for larger levels and further distances from the origin).
X.PP
XOne may call a monster by hitting '9' or 'C'.
X.PP
XUse 'X' to examine other players.
X.PP
XOne may quit or execute a sub-shell by hitting interrupt.
XQuitting during battle results in death for obvious reasons.
X.PP
XSeveral other options become available as the player progresses in
X.B level
Xand
X.B magic,
Xor to other stations in the game (
X.B valar, council of the wise, king
X).
XThese are described elsewhere.
XIn general, a control-L will force the redrawing of the screen.
X.PP
XOther things which may happen are more or less self-explanatory.
X.sh "Fighting Monsters"
XA player has several options while fighting monsters. They are as follows:
X.TP 1.5i
X.B melee
XInflicts damage on the monster, based upon
X.B strength.
XAlso decreases the monster's
X.B strength
Xsome.
X.TP 1.5i
X.B skirmish
XInflicts a little less damage than
X.B melee,
Xbut decreases the monster's
X.B quickness
Xinstead.
X.TP 1.5i
X.B evade
XAttempt to run away. Success is based upon both the player's and
Xthe monster's
X.B brains
Xand
X.B quickness.
X.TP 1.5i
X.B spell
XSeveral options for throwing spells (described elsewhere).
X.TP 1.5i
X.B nick
XHits the monster one plus the player's
X.B sword,
Xand gives the player 10% of the monster's
X.B experience.
XDecreases the monster's
X.B experience
Xan amount proportional to the amount granted.
XThis also increases the monster's quickness.
XParalyzed monsters wake up very fast when nicked.
X.TP 1.5i
X.B luckout
XThis is essentially a battle of wits with the monster. Success is based
Xupon the player's and the monster's
X.B brains.
XThe player gets credit for slaying the monster if he/she succeeds.
XOtherwise, nothing happens, and the chance to
X.B luckout
Xis lost.
X.sh "Character Statistics"
X.TP 1.5i
X.B strength
Xdetermines how much damage a character can inflict.
X.TP 1.5i
X.B quickness
Xdetermines how many chances a character gets to make decisions while
Xfighting.
X.TP 1.5i
X.B energy level
Xspecifies how much damage a character may endure before dying.
X.TP 1.5i
X.B magic level
Xdetermines which spells a character may throw, and how effective those
Xspells will be.
X.TP 1.5i
X.B brains
Xbasically, the character's intelligence; used for various fighting options
Xand spells.
X.TP 1.5i
X.B mana
Xused as a power source for throwing spells.
X.TP 1.5i
X.B experience
Xgained by fighting monsters and other characters.
X.TP 1.5i
X.B level
Xindicative of how much experience a character has accumulated; progresses
Xgeometrically as
X.B experience
Xincreases.
X.TP 1.5i
X.B poison
Xsickness which degrades a character's performance (affects
X.B energy level
Xand
X.B strength
X).
X.TP 1.5i
X.B sin
Xaccumulated as a character does certain nasty things; used only rarely
Xin normal play of the game.
X.TP 1.5i
X.B age
Xof player; roughly equivalent to number of turns.
XAs
X.B age
Xincreases, many personal statistics degenerate.
X.sh "Character Types"
XCharacter statistics are rolled randomly from the above list, according
Xto character type. The types are as follows:
X.TP 1.5i
X.B magic user
Xstrong in
X.B magic level
Xand
X.B brains
X, weak in other areas. Must rely on wits and magic to survive.
X.TP 1.5i
X.B fighter
Xgood in
X.B strength
Xand
X.B energy level
X, fairly good in other areas. This adds up to a well-equipped fighter.
X.TP 1.5i
X.B elf
Xvery high
X.B quickness
Xand above average
X.B magic level
Xare
X.B elves
Xselling points.
X.TP 1.5i
X.B dwarf
Xvery high
X.B strength
Xand
X.B energy level
X, but with a tendency to be rather slow and not too bright.
X.TP 1.5i
X.B halfling
Xrather quick and smart, with high
X.B energy level
X, but poor in
X.B magic
Xand
X.B strength.
XBorn with some
X.B experience.
X.TP 1.5i
X.B experimento
Xvery mediocre in all areas. However, the
X.B experimento
Xmay be placed almost anywhere within the playing grid.
X.PP
XThe possible ranges for starting statistics are summarized in
Xthe following table.
X.PP
X.TS
Xl c c c c c c
Xl c c c c c c.
XType Strength Quick Mana Energy Brains Magic
X_
XMag. User 10-15 30-35 50-100 30-45 60-85 5-9
XFighter 40-55 30-35 30-50 45-70 25-45 3-6
XElf 35-45 32-38 45-90 30-50 40-65 4-7
XDwarf 50-70 25-30 25-45 60-100 20-40 2-5
XHalfling 20-25 34 25-45 55-90 40-75 1-4
XExperimento 25 27 100 35 25 2
X.TE
X.PP
XNot only are the starting characteristics different for the different
Xcharacter types, the characteristics progress at different rates for the
Xdifferent types as the character goes up in
X.B level. Experimentoes'
Xcharacteristics progress randomly as one of the other types.
XThe progression as characters increase in
X.B level
Xis summarized in the following table.
X.PP
X.TS
Xl c c c c c
Xl n n n n n.
XType Strength Mana Energy Brains Magic
X_
XMag. User 2.0 75 20 6 2.75
XFighter 3.0 40 30 3.0 1.5
XElf 2.5 65 25 4.0 2.0
XDwarf 5 30 35 2.5 1
XHalfling 2.0 30 30 4.5 1
X.TE
X.PP
XThe character type also determines how much gold a player may
Xcarry, how long until
X.B rings
Xcan overcome the player, and how much
X.B poison
Xthe player can withstand.
X.sh "Spells"
XDuring the course of the game, the player may exercise his/her
Xmagic powers. These cases are described below.
X.TP 1.5i
X.B cloak
X.I magic level necessary:
X20 (plus level 7)
X.br
X.I mana used:
X35 plus 3 per rest period
X.br
XUsed during normal play. Prevents monsters from finding the character,
Xas well as hiding the player from other players. His/her coordinates
Xshow up as '?' in the
X.B players
Xoption. Players cannot collect
X.B mana,
Xfind trading posts, or discover the
X.B grail
Xwhile cloaked. Calling a monster uncloaks, as well as choosing
Xthis option while cloaked.
X.br
X.TP 1.5i
X.B teleport
X.I magic level necessary:
X40 (plus level 12)
X.br
X.I mana used:
X30 per 75 moved
X.br
XUsed during normal play. Allows the player too move with much more freedom
Xthan with the
X.B move
Xoption, at the price of expending mana. The maximum distance possible
Xto move is based upon
X.B level
Xand
X.B magic level.
X.TP 1.5i
X.B power blast
X.I magic level necessary:
Xnone
X.br
X.I mana used:
X5 times
X.B level
X.br
XUsed during inter-terminal battle. Damage is based upon
X.B magic level
Xand
X.B strength.
XHits much harder than a normal hit.
X.TP 1.5i
X.B all or nothing
X.I magic level necessary:
Xnone
X.br
X.I mana used:
X1
X.br
XUsed while combatting monsters.
XHas a 25% chance of working. If it works it hits the monster just enough
Xto kill it. If it fails, it doesn't hit the monster, and doubles the
Xmonster's
X.B quickness
Xand
X.B strength.
XParalyzed monsters wake up much quicker as a result of this spell.
X.TP 1.5i
X.B magic bolt
X.I magic level necessary:
X5
X.br
X.I mana used:
Xvariable
X.br
XUsed while combatting monsters. Hits the monster based upon the amount
Xof
X.B mana
Xexpended and
X.B magic level.
XGuaranteed to hit at least 10 per
X.B mana.
X.TP 1.5i
X.B force field
X.I magic level necessary:
X15
X.br
X.I mana used:
X30
X.br
XUsed during monster combat. Throws up a shield to protect from damage.
XThe shield is added to actual energy level, and is a fixed number, based
Xupon maximum energy. Normally, damage occurs first to the shield, and
Xthen to the players actual
X.B energy level.
X.TP 1.5i
X.B transform
X.I magic level necessary:
X25
X.br
X.I mana used:
X50
X.br
XUsed during monster combat. Transforms the monster randomly into one
Xof the 100 monsters from the monster file.
X.TP 1.5i
X.B increase might
X.I magic level necessary:
X35
X.br
X.I mana used:
X75
X.br
XUsed during combat with monsters. Increases strength up to a maximum.
X.TP 1.5i
X.B invisibility
X.I magic level necessary:
X45
X.br
X.I mana used:
X90
X.br
XUsed while fighting monsters. Makes it harder for the monster to hit,
Xby temporarily increasing the player's
X.B quickness.
XThis spell may be thrown several times, but a maximum level will be reached.
X.TP 1.5i
X.B transport
X.I magic level necessary:
X60
X.br
X.I mana used:
X125
X.br
XUsed during monster combat. Transports the monster away from the
Xplayer. Success is base upon player's
X.B magic
Xand
X.B brains,
Xand the monster's
X.B experience.
XIf it fails the player is transported instead. 60% of the time, the monster
Xwill drop any treasure it was carrying.
X.TP 1.5i
X.B paralyze
X.I magic level necessary:
X75
X.br
X.I mana used:
X150
X.br
XUsed during monster combat. "Freezes" the monster by putting its
X.B quickness
Xslightly negative. The monster will slowly wake up. Success is based
Xupon player's
X.B magic
Xand the monster's
X.B experience.
XIf it fails, nothing happens.
X.TP 1.5i
X.B specify
X.I magic level necessary:
Xnone
X.br
X.I mana used:
X1000
X.br
XUsed during monster combat only by
X.B valar
Xor
X.B council of the wise.
XAllows the player to pick which monster to fight.
X.sh "Monsters"
XMonsters get bigger as one moves farther from the origin (0,0). Rings of
Xdistance 125 from the origin determine the size. A monster's
X.B experience, energy level,
Xand
X.B brains
Xare multiplied by the size.
X.B Strength
Xis increase 50% per size over one, and
X.B quickness
Xremains the same, regardless of size.
X.PP
XAlso, nastier monsters are found as one progress farther out
Xfrom the origin. Monsters also may flock. The percent chance of that
Xhappening is designated as
X.B flock%
Xin the monster listing. Monsters outside the first ring
Xmay carry treasure, as determined by their treasure type.
XFlocking monsters, and bigger monsters increase the chances of treasure.
X.PP
XCertain monsters have special abilities; they are as follows:
X.TP 1.5i
X.B Unicorn
Xcan only be subdued if the player is in possession of a
X.B virgin.
X.TP 1.5i
X.B Modnar
Xhas random characteristics, including treasure type.
X.TP 1.5i
X.B Mimic
Xwill pick another name from the list of monsters in order to
Xconfuse.
X.TP 1.5i
X.B Dark Lord
Xvery nasty person. Does not like to be hit (especially nicked),
Xand many spells do not work well (or at all) against him.
XOne can always
X.B evade
Xfrom the
X.B Dark Lord.
X.TP 1.5i
X.B Leanan-Sidhe
Xalso a very nasty person. She will permanently sap
X.B strength
Xfrom someone.
X.TP 1.5i
X.B Saruman
Xwanders around with
X.B Wormtongue
X, who can steal a
X.B palantir.
XAlso,
X.B Saruman
Xmay turn a player's gems into gold pieces,
Xor scramble her/his stats.
X.TP 1.5i
X.B Thaumaturgist
Xcan transport a player.
X.TP 1.5i
X.B Balrog
Xinflicts damage by taking away
X.B experience
X, not
X.B energy.
X.TP 1.5i
X.B Vortex
Xmay take some
X.B mana.
X.TP 1.5i
X.B Nazgul
Xmay try to steal a
X.B ring
Xor neutralize part of one's
X.B brains.
X.TP 1.5i
X.B Tiamat
Xmay take half a players
X.B gold
Xand
X.B gems
Xand escape.
X.TP 1.5i
X.B Kobold
Xmay get nasty and steal one gold piece and run away.
X.TP 1.5i
X.B Shelob
Xmay bite, inflicting the equivalent of one
X.B poison.
X.TP 1.5i
X.B Assorted Faeries
XThese are killed if attacking someone carrying
X.B holy water.
XThese are
X.B Cluricaun, Fir Darrig, Fachan,
X.B Ghille Dhu, Bogle, Killmoulis,
Xand
X.B Bwca.
X.TP 1.5i
X.B Lamprey
Xmay bite, inflicting 1/2 of a
X.B poison.
X.TP 1.5i
X.B Shrieker
Xwill call one of its (much bigger) buddies if picked upon.
X.TP 1.5i
X.B Bonnacon
Xwill become bored with battle, fart, and run off.
X.TP 1.5i
X.B Smeagol
Xwill try to steal a
X.B ring
Xfrom a player, if given the chance.
X.TP 1.5i
X.B Succubus
Xmay inflict damage through a
X.B force field.
XThis subtracts from
X.B energy level
Xinstead of any shield the player may have thrown up.
XThis is a very easy way to die.
X.TP 1.5i
X.B Cerberus
Xloves metal and will steal all the metal treasures from
Xa player if able.
X.TP 1.5i
X.B Ungoliant
Xcan bite and poison. This inflicts five
X.B poisons
X, and also takes one from the player's
X.B quickness.
X.TP 1.5i
X.B Jabberwock
Xmay tire of battle, and leave after calling one of his friends
X(
X.B Jubjub Bird
Xor
X.B Bandersnatch
X).
X.TP 1.5i
X.B Morgoth
Xactually
X.B Modnar
X, but reserved for
X.B council of the wise, valar,
Xand
X.B ex-valar.
XFights with
X.B Morgoth
Xend when either he or the player dies. His characteristics
Xare calculated based upon the player's. The player is given
Xthe chance to ally with him. No magic, except
X.B force field
Xworks when battling
X.B Morgoth.
X.TP 1.5i
X.B Troll
Xmay regenerate its
X.B energy
Xand
X.B strength
Xwhile in battle.
X.TP 1.5i
X.B Wraith
Xmay make a player blind.
X.sh "Treasures"
XThe various treasure types are as follows:
X.TP 1.5i
X.B Type zero
X.I none
X.TP 1.5i
X.B Type one
X.I power booster
X\- adds mana.
X.br
X.I druid
X\- adds experience.
X.br
X.I holy orb
X\- subtracts 0.25 sin.
X.TP 1.5i
X.B Type two
X.I amulet
X\- protects from cursed treasure.
X.br
X.I holy water
X\- kills
X.B assorted faeries.
X.br
X.I hermit
X\- reduces sin by 25% and adds some mana.
X.TP 1.5i
X.B Type three
X.I shield
X\- adds to maximum
X.B energy level
X.br
X.I virgin
X\- used to subdue a
X.B unicorn
X, or to give much
X.B experience
X(and some
X.B sin
X).
X.br
X.I athelas
X\- subtracts one
X.B poison.
X.TP 1.5i
X.B Type four (scrolls)
X.I shield
X\- throws a bigger than normal
X.B force field.
X.br
X.I invisible
X\- temporarily puts the finder's
X.B quickness
Xto one million.
X.br
X.I ten fold strength
X\- multiplies finder's strength by ten.
X.br
X.I pick monster
X\- allows finder to pick next monster to battle.
X.br
X.I general knowledge
X\- adds to finder's
X.B brains
Xand
X.B magic level.
X.PP
XAll the scrolls except
X.B general knowledge
Xautomatically call a monster. These preserve any
Xspells that were already in effect, but are only in
Xeffect while in battle.
X.TP 1.5i
X.B Type five
X.I dagger
X\- adds to
X.B strength.
X.br
X.I armour
X\- same as a
X.B shield,
Xbut bigger.
X.br
X.I tablet
X\- adds brains.
X.TP 1.5i
X.B Type six
X.I priest
X\- rests to maximum; adds
X.B mana, brains;
Xand halves
X.B sin.
X.br
X.I Robin Hood
X\- increases
X.B shield
Xand adds permanently to
X.B strength.
X.br
X.I axe
X\- like
X.B dagger,
Xbut bigger.
X.TP 1.5i
X.B Type seven
X.I charm
X\- protects from cursed treasure (used before
X.B amulet
X); used in conjunction with
X.B blessing
Xto battle
X.B Dark Lord.
X.br
X.I Merlyn
X\- adds
X.B brains, magic,
Xand
X.B mana.
X.br
X.I war hammer
X\- like an
X.B axe,
Xbut bigger.
X.TP 1.5i
X.B Type eight
X.I healing potion
X\- sets
X.B poison
Xto -2, or subtracts two from
X.B poison,
Xwhichever is better.
X.br
X.I transporter
X\- allows finder to move anywhere.
X.br
X.I sword
X\- like a
X.B war hammer
X, but bigger.
X.TP 1.5i
X.B Type nine
X.I golden crown
X\- allows the player to become
X.B king,
Xby going to (0,0).
X.br
X.I blessing
X\- cuts
X.B sin
Xto 1/3, adds
X.B mana,
Xrests to max., kills
X.B Dark Lord
Xwith a
X.B charm,
Xand gives bearer first hit on all monsters.
X.br
X.I quicksilver
X\- adds to
X.B quickness.
X.TP 1.5i
X.B Type ten
X.I elven boots
X\- adds permanently to
X.B quickness.
X.TP 1.5i
X.B Type eleven
X.I palantir
X\- allows one to see all the other players; used by
X.B council of the wise
Xto seek the
X.B grail.
X.TP 1.5i
X.B Type twelve/thirteen
X.I ring
X\- allows one to hit much harder in battle, etc.
X.PP
XAny treasure type 10-13 monsters may instead carry a type nine treasure.
X.PP
XA monster may also be carrying
X.B gold
Xor
X.B gems.
XThese are used at
X.B trading posts
Xto buy things. A
X.B gem
Xis worth 1000 gold pieces. Too much
X.B gold
Xwill slow a player down. One may carry 1000 plus 200 per
X.B level
Xof
X.B gold.
XA
X.B gem
Xweighs one half a gold piece.
XMonsters of treasure type 7 or higher may carry
X.B gems.
X.PP
XThe chance of a cursed treasure is based upon treasure type.
XThe more valuable treasures have a greater chance of being cursed.
XA cursed treasure knocks
X.B energy level
Xvery low, and adds 0.25
X.B poison.
X.sh "Rings"
X.B Rings
Xare only carried by
X.B nazguls
Xand
X.B Dark Lord.
XThey come in four different flavors.
XAll
X.B rings
Xrest the player to maximum and cause him/her to hit much harder
Xin battle with monsters (assuming one has chosen to use the
X.B ring
Xfor battle.)
X.PP
XTwo types of
X.B rings
Xare cursed and come either from
X.B nazguls
Xor
X.B Dark Lord.
XAfter a few times of using these types, the player falls
Xunder the control of the
X.B ring,
Xand strange, random things will occur.
XEventually, the player dies, and gives his/her name to a monster
Xon the file.
XDying before the
X.B ring
Xis used up also renames the monster.
X.PP
XThe two remaining types of
X.B rings
Xare much more benign.
XThe one from a
X.B nazgul
Xis good for a limited number of battle rounds, and will save
Xthe player from death if it was being used when he/she died.
XThe one from
X.B Dark Lord
Xis the same, except that it never is used up.
X.B rings
Xdisappear after saving someone from death.
XIn general, cursed
X.B rings
Xoccur much more often than normal ones.
XIt is usually not a good idea to pick one up.
XThe only way to get rid of a
X.B ring
Xis to have a monster steal it.
X.sh "King"
XA player may become
X.B king by finding a
X.I crown
Xand going to (0,0). Players must have a
X.B level
Xin the range of 10 to 1000 to be able to find a
X.I crown.
XWhen a player with one or more
X.I crowns
Xreaches
X.B level
X1000, the
X.I crowns
Xare converted to
X.I gold.
X.PP
XOnce a player is king, he/she may do certain things while in
Xthe Lord's Chamber (0,0). These are exercised with the
X.B decree
X('0') option.
X.TP 1.5i
X.I transport
XThis is done to another player. It randomly moves the affected
Xplayer about. A
X.B charm
Xprotects from transports.
X.TP 1.5i
X.I curse
XThis is done to another player. It is analogous to cursed treasure,
Xbut worse. It inflicts two
X.B poison,
Xknocks
X.B energy level
Xvery low, and degrades the maximum energy. It also
Xremoves a
X.B cloak.
XA
X.B blessing
Xprotects from king's curses.
X.TP 1.5i
X.I energy void
XThe king may put a number these scattered about
Xhis/her kingdom as he/she pleases.
XIf a player hits one, he/she loses
X.B mana, energy,
Xand
X.B gold.
XThe energy void disappears after being hit.
X.TP 1.5i
X.I bestow
XThis is also done to another player. The king may
Xwish to reward one or more loyal subjects by sharing his/her
Xriches (
X.B gold
X). Or it is a convenient way to dispose of some unwanted
Xdeadweight.
X.TP 1.5i
X.I collect taxes
XEveryone pays 7% tax on all
X.B gold
Xand
X.B gems
Xacquired, regardless of the existence of a
X.B king.
XThe king collects the accrued taxes with this option.
X.PP
XThe
X.B king
Xmay also
X.B teleport
Xanywhere for free by using the origin as a starting place.
X.sh "Council of the Wise, Valar"
XA player automatically becomes a member of the
X.B council of the wise
Xupon reaching level 3000. Members of the council cannot have
X.B rings.
XMembers of the council have a few extra options which they can exercise.
XThese are exercised
X.B intervene
X('8') option.
XAll
X.B intervene
Xoptions cost 1000 mana.
XOne
X.B intervene
Xoption is to
X.I heal
Xanother player. This is just a quick way for that player to be rested
Xto maximum and lose a little
X.B poison.
XThe main purpose in life for members of the council is to seek the
X.B Holy Grail.
XThis is done with a
X.B palantir
Xunder the
X.I seek grail
Xoption. The distance cited by the seek is accurate within 10%, in order
Xnot to make it too easy to find the grail.
XA player must have infintesimally small
X.B sin,
Xor else it's all over upon finding the grail.
XIn order to help members of the council on their quest, they
Xmay
X.I teleport
Xwith greater ease.
X.PP
XUpon finding the grail, the player advance to position of
X.B valar.
XHe/she may then exercise more and niftier options under
X.I intervention.
XThese include all of the council members' option plus the
Xability to move other players about, bless them, and throw monsters at
Xthem.
XA
X.BR valar 's
Xblessing has the same effect as the treasure
X.I blessing,
Xexcept that the affected player does not get his/her
X.I blessing
Xflag set.
XAll
X.I intervention
Xoptions which affect other players age the player
Xwho uses them.
X.B Valar
Xare essentially immortal, but are actually given five lives.
XIf these are used up, the player is left to die, and becomes an
X.B ex-valar.
X.B Valar
Xcannot
X.I move, teleport,
Xor call monsters.
X(An exception to this is if the
X.I valar
Xfinds a
X.I transporter.
XThis is to allow him/her to dispose of excess
X.I gold.
XAny monsters which a
X.B valar
Xencounters are based upon his/her size.
XOnly one valar may exists at a time.
XThe current valar is replaced when another player finds the grail.
XThe valar is then bumped back to the council of the wise.
X.sh "Wizard"
XThe
X.I wizard
Xis usually the owner of the game, and the one who maintains
Xthe associated files.
XThe
X.I wizard
Xis granted special powers within the game, if it is invoked
Xwith the '\-S' option.
XOtherwise, the
X.I wizard
Xplays no different from other players.
XThe
X.I wizard
Xabilities are outlined below.
X.TP
X.I change players
XWhen examining a player, (game invoked with '-x', or use 'X' from within game),
Xthe
X.I wizard
Xmay also change the player.
X.TP
X.I intervention
XThe
X.I wizard
Xmay do all the
X.I intervention
Xoptions. One extra option,
X.I vaporize,
Xis added to kill any offensive players.
X.TP
X.I super character type
XAn extra character type is added. This character starts with the
Xmaximum possible in all statistics, selected from the other character types.
XA
X.B super
Xcharacter's statistics also progress at the maximum possible rate, selected
Xfrom the other character types.
X.sh "Special Places"
XCertain regions of the playing grid have different names.
XIn general, this is only to give the player some idea of
Xhis/her present location. Some special places do exist.
X.TP 1.5i
X.I Trading Posts
XThese are located at |x| == |y| == n*n*100 for n = 1, 2...1000.
XTrading posts farther out have more things for sale.
XBe careful about cheating the merchants there, as they have short
Xtempers.
XMerchants are dishonest about 5% of the time.
X.TP 1.5i
X.I Lord's Chamber
XThis is located at (0,0). Only players with
X.B crowns
Xmay enter.
X.TP 1.5i
X.I Point of No Return
XThis is located beyond 1.2e+6 in any direction.
XThe only way to return from here is a
X.B transporter
Xor to have a
X.B valar
Xrelocate the player.
X.TP 1.5i
X.I Dead Marshes
XThis is a band located fairly distant from the origin. The first
Xfourteen monsters (water monsters) can normally only be found here.
X.TP 1.5i
X.I Valhala
XThis place is where the
X.B valar
Xresides. It is associated with no particular coordinate on the
Xplaying grid.
X.TP 1.5i
X.sh "Miscellaneous"
XOnce a player reaches
X.B level
X5, the game will start to time out waiting for input.
XThis is to try to keep the game a bit faster paced.
X.PP
XA
X.I guru
Xwill never be disgusted with your
X.B sins
Xif they are less than one.
X.PP
XA
X.I medic
Xwants half of a player's
X.B gold
Xto be happy. Offering more than one has, or a negative amount
Xwill anger the
X.I medic,
Xwho will make the player worse (add one
X.B poison
X).
X.PP
XThe
X.B Holy Grail
Xdoes little for those who are not ready to behold it.
XWhenever anyone finds it, it moves.
XIt is always located within 1e+6 in any compass direction of the origin.
X.PP
XThere is a maximum amount of
X.B mana
Xand
X.B charms
Xa player may posses, based upon
X.B level.
X.I Quicksilver
Xis always limited to to a maximum of 99.
X.PP
X.I Books
Xbought at a
X.B trading post
Xincrease
X.B brains,
Xbased upon the number bought.
XIt is unwise, however to buy more than 1/10 of one's
X.B level
Xin books at a time.
X.PP
XPlayers over level 10000 are automatically retired.
X.PP
XA
X.I blindness
Xgoes away in random time.
X.PP
XPlayers with
X.I crowns
Xare identified with a '*' before their character type.
X.sh "Inter-terminal Battle"
XWhen two player's coordinates correspond, they may engage in battle.
XIn general, the player with the highest
X.B quickness
Xgets the first hit.
XIf the two players are severely mis-matched, the stronger player
Xis drastically handicapped for the battle.
XIn order to protect from being stuck in an infinite loop,
Xthe player waiting for response may time out. Options for battle are:
X.TP 1.5i
X.I fight
XInflicts damage upon other person.
X.TP 1.5i
X.I run away
XEscape from battle. Has a 75% chance of working.
X.TP 1.5i
X.I power blast
XBattle spell.
X.TP 1.5i
X.I luckout
XOne-time chance to try to win against the foe. Has a 10% chance of working.
X.PP
XSometimes waits for the other player may be excessive, because
Xhe/she may be battling a monster. Upon slaying a player in battle
Xthe winner gets the other's
X.B experience
Xand treasures.
X.B Rings
Xdo not work for inter-terminal battle.
X.SH BUGS
XAll screen formats assumme at least 24 lines by at least 80 columns.
XNo provisions are made for when any of the data items get too big
Xfor the allotted space on the screen.
!EOR!
echo x - interplayer.c
sed 's/^X//' > interplayer.c << '!EOR!'
X/*
X * interplayer.c - player to player routines for Phantasia
X */
X
X#include "include.h"
X
X/************************************************************************
X/
X/ FUNCTION NAME: checkbattle()
X/
X/ FUNCTION: check to see if current player should battle another
X/
X/ AUTHOR: E. A. Estes, 12/4/85
X/
X/ ARGUMENTS: none
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: battleplayer(), fread(), fseek()
X/
X/ GLOBAL INPUTS: Other, Users, Player, Fileloc, *Playersfp
X/
X/ GLOBAL OUTPUTS: Users
X/
X/ DESCRIPTION:
X/ Seach player file for a foe at the same coordinates as the
X/ current player.
X/ Also update user count.
X/
X/************************************************************************/
X
Xcheckbattle()
X{
Xlong foeloc = 0L; /* location in file of person to fight */
X
X Users = 0;
X fseek(Playersfp, 0L, 0);
X
X while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
X {
X if (Other.p_status != S_OFF
X && Other.p_status != S_NOTUSED
X && Other.p_status != S_HUNGUP
X && (Other.p_status != S_CLOAKED || Other.p_specialtype != SC_VALAR))
X /* player is on and not a cloaked valar */
X {
X ++Users;
X
X if (Player.p_x == Other.p_x
X && Player.p_y == Other.p_y
X /* same coordinates */
X && foeloc != Fileloc
X /* not self */
X && Player.p_status == S_PLAYING
X && (Other.p_status == S_PLAYING || Other.p_status == S_INBATTLE)
X /* both are playing */
X && Other.p_specialtype != SC_VALAR
X && Player.p_specialtype != SC_VALAR)
X /* neither is valar */
X {
X battleplayer(foeloc);
X return;
X }
X }
X foeloc += SZ_PLAYERSTRUCT;
X }
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: battleplayer()
X/
X/ FUNCTION: inter-terminal battle with another player
X/
X/ AUTHOR: E. A. Estes, 2/15/86
X/
X/ ARGUMENTS:
X/ long foeplace - location in player file of person to battle
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: readrecord(), readmessage(), writerecord(), collecttaxes(),
X/ displaystats(), fabs(), more(), death(), sleep(), wmove(), waddch(), printw(),
X/ myturn(), altercoordinates(), waddstr(), wrefresh(), mvprintw(),
X/ getanswer(), wclrtoeol(), wclrtobot()
X/
X/ GLOBAL INPUTS: Foestrikes, LINES, Lines, Other, Shield, Player, *stdscr,
X/ Fileloc, *Enemyname
X/
X/ GLOBAL OUTPUTS: Foestrikes, Lines, Shield, Player, Luckout, *Enemyname
X/
X/ DESCRIPTION:
X/ Inter-terminal battle is a very fragile and slightly klugy thing.
X/ At any time, one player is master and the other is slave.
X/ We pick who is master first by speed and level. After that,
X/ the slave waits for the master to relinquish its turn, and
X/ the slave becomes master, and so on.
X/
X/ The items in the player structure which control the handshake are:
X/ p_tampered:
X/ master increments this to relinquish control
X/ p_istat:
X/ master sets this to specify particular action
X/ p_1scratch:
X/ set to total damage inflicted so far; changes to indicate action
X/
X/************************************************************************/
X
Xbattleplayer(foeplace)
Xlong foeplace;
X{
Xdouble dtemp; /* for temporary calculations */
Xdouble oldhits = 0.0; /* previous damage inflicted by foe */
Xregister int loop; /* for timing out */
Xint ch; /* input */
Xshort oldtampered; /* old value of foe's p_tampered */
X
X Lines = 8;
X Luckout = FALSE;
X mvaddstr(4, 0, "Preparing for battle!\n");
X refresh();
X
X#ifdef SYS5
X flushinp();
X#endif
X
X /* set up variables, file, etc. */
X Player.p_status = S_INBATTLE;
X Shield = Player.p_energy;
X
X /* if p_tampered is not 0, someone else may try to change it (king, etc.) */
X Player.p_tampered = oldtampered = 1;
X Player.p_1scratch = 0.0;
X Player.p_istat = I_OFF;
X
X readrecord(&Other, foeplace);
X if (fabs(Player.p_level - Other.p_level) > 20.0)
X /* see if players are greatly mismatched */
X {
X dtemp = (Player.p_level - Other.p_level) / MAX(Player.p_level, Other.p_level);
X if (dtemp < -0.5)
X /* foe outweighs this one */
X Player.p_speed *= 2.0;
X }
X
X writerecord(&Player, Fileloc); /* write out all our info */
X
X if (Player.p_blindness)
X Enemyname = "someone";
X else
X Enemyname = Other.p_name;
X
X mvprintw(6, 0, "You have encountered %s Level: %.0f\n", Enemyname, Other.p_level);
X refresh();
X
X for (loop = 0; Other.p_status != S_INBATTLE && loop < 30; ++loop)
X /* wait for foe to respond */
X {
X readrecord(&Other, foeplace);
X sleep(1);
X }
X
X if (Other.p_status != S_INBATTLE)
X /* foe did not respond */
X {
X mvprintw(5, 0, "%s is not responding.\n", Enemyname);
X goto LEAVE;
X }
X /* else, we are ready to battle */
X
X move(4, 0);
X clrtoeol();
X
X /*
X * determine who is first master
X * if neither player is faster, check level
X * if neither level is greater, battle is not allowed
X * (this should never happen, but we have to handle it)
X */
X if (Player.p_speed > Other.p_speed)
X Foestrikes = FALSE;
X else if (Other.p_speed > Player.p_speed)
X Foestrikes = TRUE;
X else if (Player.p_level > Other.p_level)
X Foestrikes = FALSE;
X else if (Other.p_level > Player.p_level)
X Foestrikes = TRUE;
X else
X /* no one is faster */
X {
X printw("You can't fight %s yet.", Enemyname);
X goto LEAVE;
X }
X
X for (;;)
X {
X displaystats();
X readmessage();
X mvprintw(1, 26, "%20.0f", Shield); /* overprint energy */
X
X if (!Foestrikes)
X /* take action against foe */
X myturn();
X else
X /* wait for foe to take action */
X {
X mvaddstr(4, 0, "Waiting...\n");
X clrtoeol();
X refresh();
X
X for (loop = 0; loop < 20; ++loop)
X /* wait for foe to act */
X {
X readrecord(&Other, foeplace);
X if (Other.p_1scratch != oldhits)
X /* p_1scratch changes to indicate action */
X break;
X else
X /* wait and try again */
X {
X sleep(1);
X addch('.');
X refresh();
X }
X }
X
X if (Other.p_1scratch == oldhits)
X {
X /* timeout */
X mvaddstr(22, 0, "Timeout: waiting for response. Do you want to wait ? ");
X ch = getanswer("NY", FALSE);
X move(22, 0);
X clrtobot();
X if (ch == 'Y')
X continue;
X else
X break;
X }
X else
X /* foe took action */
X {
X switch (Other.p_istat)
X {
X case I_RAN: /* foe ran away */
X mvprintw(Lines++, 0, "%s ran away!", Enemyname);
X break;
X
X case I_STUCK: /* foe tried to run, but couldn't */
X mvprintw(Lines++, 0, "%s tried to run away.", Enemyname);
X break;
X
X case I_BLEWIT: /* foe tried to luckout, but didn't */
X mvprintw(Lines++, 0, "%s tried to luckout!", Enemyname);
X break;
X
X default:
X dtemp = Other.p_1scratch - oldhits;
X mvprintw(Lines++, 0, "%s hit you %.0f times!", Enemyname, dtemp);
X Shield -= dtemp;
X break;
X }
X
X oldhits = Other.p_1scratch; /* keep track of old hits */
X
X if (Other.p_tampered != oldtampered)
X /* p_tampered changes to relinquish turn */
X {
X oldtampered = Other.p_tampered;
X Foestrikes = FALSE;
X }
X }
X }
X
X /* decide what happens next */
X refresh();
X if (Lines > LINES - 2)
X {
X more(Lines);
X move(Lines = 8, 0);
X clrtobot();
X }
X
X if (Other.p_istat == I_KILLED || Shield < 0.0)
X /* we died */
X {
X Shield = -2.0; /* insure this value is negative */
X break;
X }
X
X if (Player.p_istat == I_KILLED)
X /* we killed foe; award treasre */
X {
X mvprintw(Lines++, 0, "You killed %s!", Enemyname);
X Player.p_experience += Other.p_experience;
X Player.p_crowns += (Player.p_level < 1000.0) ? Other.p_crowns : 0;
X Player.p_amulets += Other.p_amulets;
X Player.p_charms += Other.p_charms;
X collecttaxes(Other.p_gold, Other.p_gems);
X Player.p_sword = MAX(Player.p_sword, Other.p_sword);
X Player.p_shield = MAX(Player.p_shield, Other.p_shield);
X Player.p_quksilver = MAX(Player.p_quksilver, Other.p_quksilver);
X if (Other.p_virgin && !Player.p_virgin)
X {
X mvaddstr(Lines++, 0, "You have rescued a virgin. Will you be honorable ? ");
X if ((ch = getanswer("YN", FALSE)) == 'Y')
X Player.p_virgin = TRUE;
X else
X {
X ++Player.p_sin;
X Player.p_experience += 8000.0;
X }
X }
X sleep(3); /* give other person time to die */
X break;
X }
X else if (Player.p_istat == I_RAN || Other.p_istat == I_RAN)
X /* either player ran away */
X break;
X }
X
XLEAVE:
X /* clean up things and leave */
X writerecord(&Player, Fileloc); /* update a final time */
X altercoordinates(0.0, 0.0, A_NEAR); /* move away from battle site */
X Player.p_energy = Shield; /* set energy to actual value */
X Player.p_tampered = T_OFF; /* clear p_tampered */
X
X more(Lines); /* pause */
X
X move(4, 0);
X clrtobot(); /* clear bottom area of screen */
X
X if (Player.p_energy < 0.0)
X /* we are dead */
X death("Interterminal battle");
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: myturn()
X/
X/ FUNCTION: process players action against foe in battle
X/
X/ AUTHOR: E. A. Estes, 2/7/86
X/
X/ ARGUMENTS: none
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: writerecord(), inputoption(), floor(), wmove(), random(),
X/ waddstr(), wrefresh(), mvprintw(), wclrtoeol(), wclrtobot()
X/
X/ GLOBAL INPUTS: Lines, Other, Player, *stdscr, Fileloc, Luckout,
X/ *Enemyname
X/
X/ GLOBAL OUTPUTS: Foestrikes, Lines, Player, Luckout
X/
X/ DESCRIPTION:
X/ Take action action against foe, and decide who is master
X/ for next iteration.
X/
X/************************************************************************/
X
Xmyturn()
X{
Xdouble dtemp; /* for temporary calculations */
Xint ch; /* input */
X
X mvaddstr(7, 0, "1:Fight 2:Run Away! 3:Power Blast ");
X if (Luckout)
X clrtoeol();
X else
X addstr("4:Luckout ");
X
X ch = inputoption();
X move(Lines = 8, 0);
X clrtobot();
X
X switch (ch)
X {
X default: /* fight */
X dtemp = ROLL(2.0, Player.p_might);
XHIT:
X mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, dtemp);
X Player.p_sin += 0.5;
X Player.p_1scratch += dtemp;
X Player.p_istat = I_OFF;
X break;
X
X case '2': /* run away */
X Player.p_1scratch -= 1.0; /* change this to indicate action */
X if (random() > 0.25)
X {
X mvaddstr(Lines++, 0, "You got away!");
X Player.p_istat = I_RAN;
X }
X else
X {
X mvprintw(Lines++, 0, "%s is still after you!", Enemyname);
X Player.p_istat = I_STUCK;
X }
X break;
X
X case '3': /* power blast */
X dtemp = MIN(Player.p_mana, Player.p_level * 5.0);
X Player.p_mana -= dtemp;
X dtemp *= (random() + 0.5) * Player.p_magiclvl * 0.2 + 2.0;
X mvprintw(Lines++, 0, "You blasted %s !", Enemyname);
X goto HIT;
X
X case '4': /* luckout */
X if (Luckout || random() > 0.1)
X {
X if (Luckout)
X mvaddstr(Lines++, 0, "You already tried that!");
X else
X {
X mvaddstr(Lines++, 0, "Not this time . . .");
X Luckout = TRUE;
X }
X
X Player.p_1scratch -= 1.0;
X Player.p_istat = I_BLEWIT;
X }
X else
X {
X mvaddstr(Lines++, 0, "You just lucked out!");
X Player.p_1scratch = Other.p_energy * 1.1;
X }
X break;
X }
X
X refresh();
X Player.p_1scratch = floor(Player.p_1scratch); /* clean up any mess */
X
X if (Player.p_1scratch > Other.p_energy)
X Player.p_istat = I_KILLED;
X else if (random() * Player.p_speed < random() * Other.p_speed)
X /* relinquish control */
X {
X ++Player.p_tampered;
X Foestrikes = TRUE;
X }
X
X writerecord(&Player, Fileloc); /* let foe know what we did */
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: checktampered()
X/
X/ FUNCTION: check if current player has been tampered with
X/
X/ AUTHOR: E. A. Estes, 12/4/85
X/
X/ ARGUMENTS: none
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: readrecord(), fread(), fseek(), tampered(), writevoid()
X/
X/ GLOBAL INPUTS: *Energyvoidfp, Other, Player, Fileloc, Enrgyvoid
X/
X/ GLOBAL OUTPUTS: Enrgyvoid
X/
X/ DESCRIPTION:
X/ Check for energy voids, holy grail, and tampering by other
X/ players.
X/
X/************************************************************************/
X
Xchecktampered()
X{
Xlong loc = 0L; /* location in energy void file */
X
X /* first check for energy voids */
X fseek(Energyvoidfp, 0L, 0);
X while (fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp) == 1)
X if (Enrgyvoid.ev_active
X && Enrgyvoid.ev_x == Player.p_x
X && Enrgyvoid.ev_y == Player.p_y)
X /* sitting on one */
X {
X if (loc > 0L)
X /* not the holy grail; inactivate energy void */
X {
X Enrgyvoid.ev_active = FALSE;
X writevoid(&Enrgyvoid, loc);
X tampered(T_NRGVOID, 0.0, 0.0);
X }
X else if (Player.p_status != S_CLOAKED)
X /* holy grail */
X tampered(T_GRAIL, 0.0, 0.0);
X break;
X }
X else
X loc += SZ_VOIDSTRUCT;
X
X /* now check for other things */
X readrecord(&Other, Fileloc);
X if (Other.p_tampered != T_OFF)
X tampered(Other.p_tampered, Other.p_1scratch, Other.p_2scratch);
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: tampered()
X/
X/ FUNCTION: take care of tampering by other players
X/
X/ AUTHOR: E. A. Estes, 12/4/85
X/
X/ ARGUMENTS:
X/ int what - what type of tampering
X/ double arg1, arg2 - rest of tampering info
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: writerecord(), more(), fread(), death(), fseek(), sleep(),
X/ floor(), wmove(), waddch(), random(), printw(), altercoordinates(),
X/ waddstr(), wrefresh(), encounter(), writevoid()
X/
X/ GLOBAL INPUTS: Other, Player, *stdscr, Enrgyvoid, *Playersfp
X/
X/ GLOBAL OUTPUTS: Other, Player, Changed, Enrgyvoid
X/
X/ DESCRIPTION:
X/ Take care of energy voids, holy grail, decree and intervention
X/ action on current player.
X/
X/************************************************************************/
X
Xtampered(what, arg1, arg2)
Xint what;
Xdouble arg1;
Xdouble arg2;
X{
Xlong loc; /* location in file of other players */
X
X Changed = TRUE;
X move(4,0);
X
X Player.p_tampered = T_OFF; /* no longer tampered with */
X
X switch (what)
X {
X case T_NRGVOID:
X addstr("You've hit an energy void !\n");
X Player.p_mana /= 3.0;
X Player.p_energy /= 2.0;
X Player.p_gold = floor(Player.p_gold/1.25) + 0.1;
X altercoordinates(0.0, 0.0, A_NEAR);
X break;
X
X case T_TRANSPORT:
X addstr("The king transported you ! ");
X if (Player.p_charms > 0)
X {
X addstr("But your charm save you. . .\n");
X --Player.p_charms;
X }
X else
X {
X altercoordinates(0.0, 0.0, A_FAR);
X addch('\n');
X }
X break;
X
X case T_BESTOW:
X printw("The king has bestowed %.0f gold pieces on you !\n", arg1);
X Player.p_gold += arg1;
X break;
X
X case T_CURSED:
X addstr("You've been cursed ! ");
X if (Player.p_blessing)
X {
X addstr("But your blessing saved you. . .\n");
X Player.p_blessing = FALSE;
X }
X else
X {
X addch('\n');
X Player.p_poison += 2.0;
X Player.p_energy = 10.0;
X Player.p_maxenergy *= 0.95;
X Player.p_status = S_PLAYING; /* no longer cloaked */
X }
X break;
X
X case T_VAPORIZED:
X addstr("You have been vaporized!\n");
X more(7);
X death("Vaporization");
X break;
X
X case T_MONSTER:
X addstr("The Valar zapped you with a monster!\n");
X more(7);
X encounter((int) arg1);
X return;
X
X case T_BLESSED:
X addstr("The Valar has blessed you!\n");
X Player.p_energy = (Player.p_maxenergy *= 1.05) + Player.p_shield;
X Player.p_mana += 500.0;
X Player.p_strength += 0.5;
X Player.p_brains += 0.5;
X Player.p_magiclvl += 0.5;
X Player.p_poison = MIN(0.5, Player.p_poison);
X break;
X
X case T_RELOCATE:
X addstr("You've been relocated. . .\n");
X altercoordinates(arg1, arg2, A_FORCED);
X break;
X
X case T_HEAL:
X addstr("You've been healed!\n");
X Player.p_poison -= 0.25;
X Player.p_energy = Player.p_maxenergy + Player.p_shield;
X break;
X
X case T_EXVALAR:
X addstr("You are no longer Valar!\n");
X Player.p_specialtype = SC_COUNCIL;
X break;
X
X case T_GRAIL:
X addstr("You have found The Holy Grail!!\n");
X if (Player.p_specialtype < SC_COUNCIL)
X /* must be council of wise to behold grail */
X {
X addstr("However, you are not experienced enough to behold it.\n");
X Player.p_sin *= Player.p_sin;
X Player.p_mana += 1000;
X }
X else if (Player.p_specialtype == SC_VALAR
X || Player.p_specialtype == SC_EXVALAR)
X {
X addstr("You have made it to the position of Valar once already.\n");
X addstr("The Grail is of no more use to you now.\n");
X }
X else
X {
X addstr("It is now time to see if you are worthy to behold it. . .\n");
X refresh();
X sleep(4);
X
X if (random() / 2.0 < Player.p_sin)
X {
X addstr("You have failed!\n");
X Player.p_strength =
X Player.p_mana =
X Player.p_energy =
X Player.p_maxenergy =
X Player.p_magiclvl =
X Player.p_brains =
X Player.p_experience =
X Player.p_quickness = 1.0;
X
X altercoordinates(1.0, 1.0, A_FORCED);
X Player.p_level = 0.0;
X }
X else
X {
X addstr("You made to position of Valar!\n");
X Player.p_specialtype = SC_VALAR;
X Player.p_lives = 5;
X fseek(Playersfp, 0L, 0);
X loc = 0L;
X while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
X /* search for existing valar */
X if (Other.p_specialtype == SC_VALAR
X && Other.p_status != S_NOTUSED)
X /* found old valar */
X {
X Other.p_tampered = T_EXVALAR;
X writerecord(&Other, loc);
X break;
X }
X else
X loc += SZ_PLAYERSTRUCT;
X }
X }
X
X /* move grail to new location */
X Enrgyvoid.ev_active = TRUE;
X Enrgyvoid.ev_x = ROLL(-1e6, 2e6);
X Enrgyvoid.ev_y = ROLL(-1e6, 2e6);
X writevoid(&Enrgyvoid, 0L);
X break;
X }
X refresh();
X sleep(2);
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: userlist()
X/
X/ FUNCTION: print list of players and locations
X/
X/ AUTHOR: E. A. Estes, 2/28/86
X/
X/ ARGUMENTS:
X/ bool ingameflag - set if called while playing
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: descrstatus(), descrlocation(), more(), fread(), fseek(),
X/ floor(), wmove(), printw(), waddstr(), distance(), wrefresh(),
X/ descrtype(), wclrtobot()
X/
X/ GLOBAL INPUTS: LINES, Other, Circle, Wizard, Player, *stdscr, *Playersfp
X/
X/ GLOBAL OUTPUTS: none
X/
X/ DESCRIPTION:
X/ We can only see the coordinate of those closer to the origin
X/ from us.
X/ Kings and council of the wise can see and can be seen by everyone.
X/ Palantirs are good for seeing everyone; and the valar can use
X/ one to see through a 'cloak' spell.
X/ The valar has no coordinates, and is completely invisible if
X/ cloaked.
X/
X/************************************************************************/
X
Xuserlist(ingameflag)
Xbool ingameflag;
X{
Xregister int numusers = 0; /* number of users on file */
X
X if (ingameflag && Player.p_blindness)
X {
X mvaddstr(8, 0, "You cannot see anyone.\n");
X return;
X }
X
X fseek(Playersfp, 0L, 0);
X mvaddstr(8, 0,
X "Name X Y Lvl Type Login Status\n");
X
X while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
X {
X if (Other.p_status == S_NOTUSED
X /* record is unused */
X || (Other.p_specialtype == SC_VALAR && Other.p_status == S_CLOAKED))
X /* cloaked valar */
X {
X if (!Wizard)
X /* wizard can see everything on file */
X continue;
X }
X
X ++numusers;
X
X if (ingameflag &&
X /* must be playing for the rest of these conditions */
X (Player.p_specialtype >= SC_KING
X /* kings and higher can see others */
X || Other.p_specialtype >= SC_KING
X /* kings and higher can be seen by others */
X || Circle >= CIRCLE(Other.p_x, Other.p_y)
X /* those nearer the origin can be seen */
X || Player.p_palantir)
X /* palantir enables one to see others */
X && (Other.p_status != S_CLOAKED
X || (Player.p_specialtype == SC_VALAR && Player.p_palantir))
X /* not cloaked; valar can see through cloak with a palantir */
X && Other.p_specialtype != SC_VALAR)
X /* not a valar */
X /* coordinates should be printed */
X printw("%-20s %8.0f %8.0f ",
X Other.p_name, Other.p_x, Other.p_y);
X else
X /* cannot see player's coordinates */
X printw("%-20s %19.19s ",
X Other.p_name, descrlocation(&Other, TRUE));
X
X printw("%6.0f %s %-9.9s%s\n", Other.p_level, descrtype(&Other, TRUE),
X Other.p_login, descrstatus(&Other));
X
X if ((numusers % (LINES - 10)) == 0)
X {
X more(LINES - 1);
X move(9, 0);
X clrtobot();
X }
X }
X
X printw("Total players on file = %d\n", numusers);
X refresh();
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: throneroom()
X/
X/ FUNCTION: king stuff upon entering throne
X/
X/ AUTHOR: E. A. Estes, 12/16/85
X/
X/ ARGUMENTS: none
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: writerecord(), fread(), fseek(), fopen(), wmove(), fclose(),
X/ fwrite(), altercoordinates(), waddstr(), fprintf()
X/
X/ GLOBAL INPUTS: *Energyvoidfp, Other, Player, *stdscr, Voidfile[],
X/ Messfile[], Enrgyvoid, *Playersfp
X/
X/ GLOBAL OUTPUTS: Other, Player, Changed
X/
X/ DESCRIPTION:
X/ If player is not already king, make him/her so if the old king
X/ is not playing.
X/ Clear energy voids with new king.
X/ Print 'decree' prompt.
X/
X/************************************************************************/
X
Xthroneroom()
X{
XFILE *fp; /* to clear energy voids */
Xlong loc = 0L; /* location of old king in player file */
X
X if (Player.p_specialtype < SC_KING)
X /* not already king -- assumes crown */
X {
X fseek(Playersfp, 0L, 0);
X while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
X if (Other.p_specialtype == SC_KING && Other.p_status != S_NOTUSED)
X /* found old king */
X {
X if (Other.p_status != S_OFF)
X /* old king is playing */
X {
X mvaddstr( 4, 0, "The king is playing, so you cannot steal his throne\n");
X altercoordinates(0.0, 0.0, A_NEAR);
X move(6, 0);
X return;
X }
X else
X /* old king is not playing - remove him/her */
X {
X Other.p_specialtype = SC_NONE;
X if (Other.p_crowns)
X --Other.p_crowns;
X writerecord(&Other, loc);
X break;
X }
X }
X else
X loc += SZ_PLAYERSTRUCT;
X
X /* make player new king */
X Changed = TRUE;
X Player.p_specialtype = SC_KING;
X mvaddstr(4, 0, "You have become king!\n");
X
X /* let everyone else know */
X fp = fopen(Messfile, "w");
X fprintf(fp, "All hail the new king!");
X fclose(fp);
X
X /* clear all energy voids; retain location of holy grail */
X fseek(Energyvoidfp, 0L, 0);
X fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp);
X fp = fopen(Voidfile, "w");
X fwrite((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, fp);
X fclose(fp);
X }
X
X mvaddstr(6, 0, "0:Decree ");
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: dotampered()
X/
X/ FUNCTION: king and valar special options
X/
X/ AUTHOR: E. A. Estes, 2/28/86
X/
X/ ARGUMENTS: none
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: writerecord(), truncstring(), fread(), fseek(), fopen(),
X/ floor(), wmove(), random(), fclose(), fwrite(), sscanf(), strcmp(),
X/ infloat(), waddstr(), findname(), distance(), userlist(), mvprintw(),
X/ allocvoid(), getanswer(), getstring(), wclrtoeol(), writevoid()
X/
X/ GLOBAL INPUTS: *Energyvoidfp, Other, Illcmd[], Wizard, Player, *stdscr,
X/ Databuf[], Goldfile[], Enrgyvoid
X/
X/ GLOBAL OUTPUTS: Other, Player, Enrgyvoid
X/
X/ DESCRIPTION:
X/ Tamper with other players. Handle king/valar specific options.
X/
X/************************************************************************/
X
Xdotampered()
X{
Xshort tamper; /* value for tampering with other players */
Xchar *option; /* pointer to option description */
Xdouble temp1 = 0.0, temp2 = 0.0; /* other tampering values */
Xint ch; /* input */
Xlong loc; /* location in energy void file */
XFILE *fp; /* for opening gold file */
X
X move(6, 0);
X clrtoeol();
X if (Player.p_specialtype < SC_COUNCIL && !Wizard)
X /* king options */
X {
X addstr("1:Transport 2:Curse 3:Energy Void 4:Bestow 5:Collect Taxes ");
X
X ch = getanswer(" ", TRUE);
X move(6, 0);
X clrtoeol();
X move(4, 0);
X switch (ch)
X {
X case '1': /* transport someone */
X tamper = T_TRANSPORT;
X option = "transport";
X break;
X
X case '2': /* curse another */
X tamper = T_CURSED;
X option = "curse";
X break;
X
X case '3': /* create energy void */
X if ((loc = allocvoid()) > 20L * SZ_VOIDSTRUCT)
X /* can only have 20 void active at once */
X mvaddstr(5, 0, "Sorry, void creation limit reached.\n");
X else
X {
X addstr("Enter the X Y coordinates of void ? ");
X getstring(Databuf, SZ_DATABUF);
X sscanf(Databuf, "%F %F", &temp1, &temp2);
X Enrgyvoid.ev_x = floor(temp1);
X Enrgyvoid.ev_y = floor(temp2);
X Enrgyvoid.ev_active = TRUE;
X writevoid(&Enrgyvoid, loc);
X mvaddstr(5, 0, "It is done.\n");
X }
X return;
X
X case '4': /* bestow gold to subject */
X tamper = T_BESTOW;
X addstr("How much gold to bestow ? ");
X temp1 = infloat();
X if (temp1 > Player.p_gold || temp1 < 0)
X {
X mvaddstr(5, 0, "You don't have that !\n");
X return;
X }
X
X Player.p_gold -= floor(temp1);
X option = "give gold to";
X break;
X
X case '5': /* collect accumulated taxes */
X if ((fp = fopen(Goldfile, "r+")) != NULL)
X /* collect taxes */
X {
X fread((char *) &temp1, sizeof(double), 1, fp);
X fseek(fp, 0L, 0);
X /* clear out value */
X temp2 = 0.0;
X fwrite((char *) &temp2, sizeof(double), 1, fp);
X fclose(fp);
X }
X
X mvprintw(4, 0, "You have collected %.0f in gold.\n", temp1);
X Player.p_gold += floor(temp1);
X return;
X
X default:
X return;
X }
X /* end of king options */
X }
X else
X /* council of wise, valar, wizard options */
X {
X addstr("1:Heal ");
X if (Player.p_palantir || Wizard)
X addstr("2:Seek Grail ");
X if (Player.p_specialtype == SC_VALAR || Wizard)
X addstr("3:Throw Monster 4:Relocate 5:Bless ");
X if (Wizard)
X addstr("6:Vaporize ");
X
X ch = getanswer(" ", TRUE);
X if (!Wizard)
X {
X if (ch > '2' && Player.p_specialtype != SC_VALAR)
X {
X ILLCMD();
X return;
X }
X
X if (Player.p_mana < MM_INTERVENE)
X {
X mvaddstr(5, 0, "No mana left.\n");
X return;
X }
X else
X Player.p_mana -= MM_INTERVENE;
X }
X
X switch (ch)
X {
X case '1': /* heal another */
X tamper = T_HEAL;
X option = "heal";
X break;
X
X case '2': /* seek grail */
X if (Player.p_palantir)
X /* need a palantir to seek */
X {
X fseek(Energyvoidfp, 0L, 0);
X fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp);
X temp1 = distance(Player.p_x, Enrgyvoid.ev_x, Player.p_y, Enrgyvoid.ev_y);
X temp1 += ROLL(-temp1 / 10.0, temp1 / 5.0); /* add some error */
X mvprintw(5, 0, "The palantir says the Grail is about %.0f away.\n", temp1);
X }
X else
X /* no palantir */
X mvaddstr(5, 0, "You need a palantir to seek the Grail.\n");
X return;
X
X case '3': /* lob monster at someone */
X mvaddstr(4, 0, "Which monster [0-99] ? ");
X temp1 = infloat();
X temp1 = MAX(0.0, MIN(99.0, temp1));
X tamper = T_MONSTER;
X option = "throw a monster at";
X break;
X
X case '4': /* move another player */
X mvaddstr(4, 0, "New X Y coordinates ? ");
X getstring(Databuf, SZ_DATABUF);
X sscanf(Databuf, "%F %F", &temp1, &temp2);
X tamper = T_RELOCATE;
X option = "relocate";
X break;
X
X case '5': /* bless a player */
X tamper = T_BLESSED;
X option = "bless";
X break;
X
X case '6': /* kill off a player */
X if (Wizard)
X {
X tamper = T_VAPORIZED;
X option = "vaporize";
X break;
X }
X else
X return;
X
X default:
X return;
X }
X
X if (!Wizard)
X Player.p_age += N_AGE; /* penalty for using this stuff */
X /* end of valar, etc. options */
X }
X
X for (;;)
X /* prompt for player to affect */
X {
X mvprintw(4, 0, "Who do you want to %s ? ", option);
X getstring(Databuf, SZ_DATABUF);
X truncstring(Databuf);
X
X if (Databuf[0] == '\0')
X userlist(TRUE);
X else
X break;
X }
X
X if (strcmp(Player.p_name, Databuf) != 0)
X /* name other than self */
X {
X if ((loc = findname(Databuf, &Other)) >= 0L)
X {
X if (Other.p_tampered != T_OFF)
X {
X mvaddstr(5, 0, "That person has something pending already.\n");
X return;
X }
X else
X {
X if (tamper == T_RELOCATE
X && CIRCLE(temp1, temp2) < CIRCLE(Other.p_x, Other.p_y)
X && !Wizard)
X mvaddstr(5, 0, "Cannot move someone closer to the Lord's Chamber.\n");
X else
X {
X Other.p_tampered = tamper;
X Other.p_1scratch = floor(temp1);
X Other.p_2scratch = floor(temp2);
X writerecord(&Other, loc);
X mvaddstr(5, 0, "It is done.\n");
X }
X return;
X }
X }
X else
X /* player not found */
X mvaddstr(5, 0, "There is no one by that name.\n");
X }
X else
X /* self */
X mvaddstr(5, 0, "You may not do it to yourself!\n");
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: writevoid()
X/
X/ FUNCTION: update energy void entry in energy void file
X/
X/ AUTHOR: E. A. Estes, 12/4/85
X/
X/ ARGUMENTS:
X/ struct energyvoid *vp - pointer to structure to write to file
X/ long loc - location in file to update
X/
X/ RETURN VALUE: none
X/
X/ MODULES CALLED: fseek(), fwrite(), fflush()
X/
X/ GLOBAL INPUTS: *Energyvoidfp
X/
X/ GLOBAL OUTPUTS: none
X/
X/ DESCRIPTION:
X/ Write out energy void structure at specified location.
X/
X/************************************************************************/
X
Xwritevoid(vp, loc)
Xregister struct energyvoid *vp;
Xlong loc;
X{
X
X fseek(Energyvoidfp, loc, 0);
X fwrite((char *) vp, SZ_VOIDSTRUCT, 1, Energyvoidfp);
X fflush(Energyvoidfp);
X}
X/**/
X/************************************************************************
X/
X/ FUNCTION NAME: allocvoid()
X/
X/ FUNCTION: allocate space for a new energy void
X/
X/ AUTHOR: E. A. Estes, 12/4/85
X/
X/ ARGUMENTS: none
X/
X/ RETURN VALUE: location of new energy void space
X/
X/ MODULES CALLED: fread(), fseek()
X/
X/ GLOBAL INPUTS: *Energyvoidfp, Enrgyvoid
X/
X/ GLOBAL OUTPUTS: none
X/
X/ DESCRIPTION:
X/ Search energy void file for an inactive entry and return its
X/ location.
X/ If no inactive ones are found, return one more than last location.
X/
X/************************************************************************/
X
Xlong
Xallocvoid()
X{
Xlong loc = 0L; /* location of new energy void */
X
X fseek(Energyvoidfp, 0L, 0);
X while (fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp) == 1)
X if (Enrgyvoid.ev_active)
X loc += SZ_VOIDSTRUCT;
X else
X break;
X
X return(loc);
X}
!EOR!